Future of VB.NET? [closed]
Posted
by
Alex Yeung
on Stack Overflow
See other posts from Stack Overflow
or by Alex Yeung
Published on 2011-01-10T22:44:05Z
Indexed on
2011/01/10
22:54 UTC
Read the original article
Hit count: 292
Hi all,
I worked with C# for years. Last year, I changed my job and the company use VB.NET. Of course, theoretically C# and VB.NET are very similar and I easily adapted. However, I have worked for VB.NET for 1 year. I cannot see any future of VB.NET. As a programming language, it is so foo.
Here is a list of what C# can do but VB.NET cannot
- Case insensitive variables
- how to think a new variable name? If I have a property called
FolderPath
, i need to establish another private variable called_folderPath
orm_folderPath
. In C#,FolderPath
andfolderPath
are two variables. - Moreover, it gets compile error if variable name is same as a class name. For example
Dim guid = Guid.NewGuid()
. (What the...) Again, I need to think a new variable name.
- how to think a new variable name? If I have a property called
- Adhoc scope
- In C#, we could use
{...}
to create a adhoc scope and all resource in{...}
will not affect the code outside. However there is not such syntax in VB.NET. I could only useIf True Then
andEnd If
to make a local scope which is so unclear.
- In C#, we could use
- In-Method Region
- Sometime, it is unavoidable to have a long long method. VB.NET does not support in-method region. I always need to scroll down for 1000 lines. It wastes my time.
- No multi-line string definition
- In C#, we could
var s = @"..."
to define a multi-line string. In VB.NET there is no direct method to do that. The indirect way is use XML-literal string.Dim s = <![CDATA[...]]>.Value
. However it is unclear.
- In C#, we could
- No block comment
- In C#, we have line comment
//
and block comment/* ... */
. However in VB.NET we only have line comment which is a very big trouble for me.
- In C#, we have line comment
- No statement end symbol
- Statements are separated by line break in VB.NET; while statements are separated by
;
in C#.
- Statements are separated by line break in VB.NET; while statements are separated by
- Underscore
- I think many people know underscore
_
is continue statement symbol. I really disagree with that. I know MS VB.NET language team is going to remove the underscore syntax from VB.NET. However what can we do now? Although underscore is removed in the future, what's the advantage of that? I cannot see any advantage!
- I think many people know underscore
With
scopeWith
scope is an evil scope. Although it allows shorter statement, it is hard to trace.
- Default Namesapce in project level
- It is a nightmare for me.
The only advantage of VB.NET is property initialization. I think C# cannot do that (correct me if I am wrong.)
Public Property ThisIsMyProperty As String = "MyValue"
Remarks: I don't think optional method parameters is an advantage of OOP.
By those disadvantages, I cannot see the future of VB.NET.
Anyone sees the future of VB.NET?
© Stack Overflow or respective owner